import React from 'react';
import {Form, Modal} from "antd";
import ProForm from '@ant-design/pro-form';

const AddModal = (props) => {
  const {addCard,open,closed} = props;
  const [form] = Form.useForm();

  return (
    <div>
      <Modal
        visible={addCard}
        destroyOnClose={true}
        onOk={()=>{
          form.validateFields().then(async values =>{
            open(values)
          })
        }}
        onCancel={closed}
      >
        <ProForm
          form={form}
          submitter={false}
        >

        </ProForm>
      </Modal>
    </div>
  );
};

export default AddModal;
